using SqlSugar;
using System;

namespace B.S.XZYData.Domain.LJC
{
    /// <summary>
    /// 工单
    /// </summary>
    [SugarTable("wo")]
    public class WorkOrderModel
    {
        /// <summary>
        /// 主键 ID
        /// </summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 工单编号
        /// </summary>
        [SugarColumn(ColumnName = "code", Length = 30, IsNullable = false)]
        public string Code { get; set; }

        /// <summary>
        /// 来源计划明细 ID
        /// </summary>
        [SugarColumn(ColumnName = "plan_itm", IsNullable = true)]
        public int? PlanItemId { get; set; }

        /// <summary>
        /// 工艺路线 ID
        /// </summary>
        [SugarColumn(ColumnName = "route_id", IsNullable = true)]
        public int? RouteId { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [SugarColumn(ColumnName = "pr_code", Length = 30)]
        public string? ProductCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [SugarColumn(ColumnName = "pr_name", Length = 100)]
        public string? ProductName { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        [SugarColumn(ColumnName = "spec", Length = 100)]
        public string? Spec { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [SugarColumn(ColumnName = "unit", Length = 20)]
        public string? Unit { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        [SugarColumn(ColumnName = "qty_pl")]
        public int? PlannedQuantity { get; set; }

        /// <summary>
        /// 实际数量
        /// </summary>
        [SugarColumn(ColumnName = "qty_ac")]
        public int? ActualQuantity { get; set; }

        /// <summary>
        /// 良品数量
        /// </summary>
        [SugarColumn(ColumnName = "good")]
        public int? GoodQuantity { get; set; }

        /// <summary>
        /// 不良品数量
        /// </summary>
        [SugarColumn(ColumnName = "bad")]
        public int? BadQuantity { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnName = "stat", Length = 20)]
        public string? Status { get; set; }

        /// <summary>
        /// 计划开始时间
        /// </summary>
        [SugarColumn(ColumnName = "t_s_pl", IsNullable = true)]
        public DateTime? PlannedStartTime { get; set; }

        /// <summary>
        /// 计划结束时间
        /// </summary>
        [SugarColumn(ColumnName = "t_e_pl", IsNullable = true)]
        public DateTime? PlannedEndTime { get; set; }

        /// <summary>
        /// 实际开始时间
        /// </summary>
        [SugarColumn(ColumnName = "t_s_ac", IsNullable = true)]
        public DateTime? ActualStartTime { get; set; }

        /// <summary>
        /// 实际结束时间
        /// </summary>
        [SugarColumn(ColumnName = "t_e_ac", IsNullable = true)]
        public DateTime? ActualEndTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnName = "remk", Length = 255)]
        public string? Remark { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(ColumnName = "c_by", Length = 50)]
        public string? CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "c_tm")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [SugarColumn(ColumnName = "u_by", Length = 50)]
        public string? UpdateBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(ColumnName = "u_tm")]
        public DateTime? UpdateTime { get; set; }
    }
} 